<div class="col-sm-12 col-md-12">

    <div class="row">
        <div class="col-sm-12 col-md-12">
            <form class="form-custom clearfix">
            <div class="col-sm-2 col-md-2">
                <select id="status" ng-model="params.isPaid" select2 class="form-control">
                    <option value="">到款状态</option>
                    <option value="0">未确认</option>
                    <option value="1">已完成</option>
                    <option value="2">已退款</option>
                </select>
            </div>
                <div class="col-sm-3 col-md-3">
	                <button class="btn btn-custom" type="submit" ng-click="refresh('first',true)">查询</button>            
                    <button class="btn btn-custom" type="button" data-toggle="modal" data-target="#add" ng-click="clearForm()" upload-refresh>添加申请 </button>
                </div>
            </form>
        </div>
    </div>
	<div style="color:red">处理状态不代表银行的状态。</div>
    <table class="table table-striped table-bordered table-condensed index-center  table-costom">
        <thead>
        <tr>
            <th>序号</th>
            <th>用户名称</th>
            <th>支付时间</th>
            <th>类型</th>
            <th>金额</th>
            <th style="width:80px">处理状态</th>
            <th style="width:80px">操作员</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr class="rowlink" ng-repeat="item in limitArr">
            <td>{{current*limit+$index+1}}</td>
            <td>{{item.mUserName}}</td>
            <td>{{item.paidTime|date:'yyyy-MM-dd HH:mm'}}</td>
            <td ng-if="item.processType==0">充值</td><td ng-if="item.processType==1">提现</td>
            <td>{{item.amount}}</td>
            <td ng-if="item.isPaid==0">未确认</td><td ng-if="item.isPaid==1">已完成</td><td ng-if="item.isPaid==2">已退款</td><td ng-if="item.isPaid==3">银行处理中</td>
            <td>{{item.adminUser}}</td>
            <td ng-if="item.isPaid==0">
                <a href="javascript:" data-toggle="modal" data-target="#preview" ng-click="preview(item)">预览</a>
                <a href="javascript:" data-toggle="modal" data-target="#edit" ng-click="edit(item)">确认</a> 
                <a href="javascript:" data-toggle="modal" data-target="#removeDialog" ng-click="todelete(item.accountId)">删除</a>
            </td>
            <td ng-if="item.isPaid==1">
                <a href="javascript:" data-toggle="modal" data-target="#preview" ng-click="preview(item)">预览</a>
                <a ng-if="item.processType==0 && item.orderId!=null" href="javascript:" data-toggle="modal" data-target="#queryPay" ng-click="queryPay(item.orderId)">易宝充值详细</a>
                <a ng-if="item.processType==1 && item.orderId!=null" href="javascript:" data-toggle="modal" data-target="#queryPay" ng-click="queryWithdraw(item.orderId)">易宝提现详细</a>
                <a ng-if="item.processType==0 && item.isPaid==1 && item.orderId!=null" href="javascript:" data-toggle="modal" data-target="#refundDialog" ng-click="refund(item.orderId)">退款</a>
            </td>
            <td ng-if="item.isPaid==2">
                <a href="javascript:" data-toggle="modal" data-target="#preview" ng-click="preview(item)">预览</a>
                <a ng-if="item.processType==0" href="javascript:" data-toggle="modal" data-target="#queryRefund" ng-click="queryRefund(item.orderId)">易宝退款详细</a>
            </td>
        </tr>
        </tbody>
    </table>
            <div data-remote-paging="pager" 
					data-refresh="refresh" 
					data-current="current" 
					data-total="total" 
					data-data="limitArr"
					data-limit="limit"
					data-params="params"
			></div>
</div>

<!-- 修改对话框 -->
<div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-hidden="true">
<form class="form-horizontal" name="editSyncApplForm" novalidate="novalidate" ng-submit="create(pageitem)" >
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4  class="modal-title">确认</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12 col-md-12">
                        <div class="form-group">
用户名称：{{pageitem.mUserName}}<br />
操作时间：{{pageitem.createTime|date:'yyyy-MM-dd HH:mm'}}<br />
类型：<span ng-if="pageitem.processType==0">充值</span><span ng-if="pageitem.processType==1">提现</span><br />
金额：{{pageitem.amount}}<br />
                        </div>
                        <div class="form-group">
			                <label class="col-lg-2 control-label">管理员备注：</label>
			                <div class="col-lg-9">
			                    <input type="text" class="form-control" ng-model="pageitem.adminNote" ng-maxlength="50" ng-trim maxlength="50" />
			                </div>
                        </div>
	                    <div class="form-group">
	                        <label class="col-lg-2 control-label">到款状态：</label>
	                        <div class="col-lg-9">
	                            <label class="radio-inline"><input type="radio" class="" ng-model="pageitem.isPaid" value="0" name="status"/>未确认</label>
	                            <label class="radio-inline"><input type="radio" class="" ng-model="pageitem.isPaid" value="1" name="status"/><span ng-if="pageitem.processType==0">已到账</span><span ng-if="pageitem.processType==1">可以提现</span></label>
	                        </div>
	                    </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" ng-disabled="editSyncApplForm.$invalid">保存</button>
                <button type="button" class="btn btn-danger" ng-click="clearForm()">重置</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    </form>
    <!-- /.modal-dialog -->
</div>

<!-- 新增对话框 -->
<div class="modal fade" id="add" tabindex="-1" role="dialog" aria-hidden="true">
<form class="form-horizontal" name="addSyncApplForm" novalidate="novalidate" ng-submit="create(key)" >
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">新增</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12 col-md-12">
                        <div class="form-group">
			                <label class="col-lg-2 control-label">移动用户id：</label>
			                <div class="col-lg-9">
			                    <input type="text" class="form-control" ng-model="key.mUserId" ng-maxlength="50" ng-trim maxlength="50" />
			                </div>
                        </div>
                        <div class="form-group">
			                <label class="col-lg-2 control-label">金额：</label>
			                <div class="col-lg-9">
			                    <input type="text" class="form-control" ng-model="key.amount" ng-maxlength="50" ng-trim maxlength="50" />
			                </div>
                        </div>
	                    <div class="form-group">
	                        <label class="col-lg-2 control-label">类型：</label>
	                        <div class="col-lg-9">
	                            <label class="radio-inline"><input type="radio" class="" required ng-model="key.processType" value="0" name="type"/>充值</label>
	                            <label class="radio-inline"><input type="radio" class="" required ng-model="key.processType" value="1" name="type"/>提现</label>
	                        </div>
							<span class="mustItem">*</span>
	                    </div>
                        <div class="form-group">
			                <label class="col-lg-2 control-label">管理员备注：</label>
			                <div class="col-lg-9">
			                    <input type="text" class="form-control" ng-model="key.adminNote" ng-maxlength="50" ng-trim maxlength="50" />
			                </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" ng-disabled="addSyncApplForm.$invalid">保存</button>
                <button type="button" class="btn btn-danger" ng-click="clearForm()">重置</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    </form>
    <!-- /.modal-dialog -->
</div>

<!-- 删除对话框 -->
<div class="modal fade" id="removeDialog" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">删除</h4>
            </div>
            <div class="modal-body">
                                                     确认要删除么？
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" ng-click="comfirmDelete()" data-dismiss="modal">确认删除</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 预览 -->
<div class="modal fade" id="preview" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;height:392px; ">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">预览</h4>
            </div>
            <div class="modal-body">
            	<div class="col-sm-12 col-md-12">
	            <form role="form" class="form-horizontal">
	                <div class="form-group">&nbsp;</div>
           			<div class="form-group"  style=" height:332px; ">
                        <p class="col-lg-6">
用户名称：{{keyv.mUserName}}<br />
操作时间：{{keyv.createTime|date:'yyyy-MM-dd HH:mm'}}<br />
类型：<span ng-if="keyv.processType==0">充值</span><span ng-if="keyv.processType==1">提现</span><br />
金额：{{keyv.amount}}<br />
操作员：{{keyv.adminUser}}<br />
管理员备注：{{keyv.adminNote}}<br />
                        </p>  
                  	</div>
                   <div class="form-group">&nbsp;</div>
	            </form>
	            </div> <!-- col-sm-12 col-md-12 end -->
            </div><!-- modal-conteng end -->
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div><!-- /.modal -->  

<!-- 易宝充值详细 -->
<div class="modal fade" id="queryPay" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;height:392px; ">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">充值详细</h4>
            </div>
            <div class="modal-body">
            	<div class="col-sm-12 col-md-12">
	                <div class="form-group">&nbsp;</div>
           			<div class="form-group"  style=" height:332px; ">
                        <p class="col-lg-6">
客户订单号： {{result.orderid}}<br />
易宝交易流水号： {{result.yborderid}}<br />
订单金额（分）： {{result.amount}}<br />
付款方手续费（分）： {{result.sourcefee}}<br />
收款方手续费（分）： {{result.targetfee}}<br />
付款方实付金额（分）： {{result.sourceamount}}<br />
收款方实收金额（分）： {{result.targetamount}}<br />
支付类型：<span ng-if="result.type==1">银行卡 </span><span ng-if="result.status==2">非银行卡</span><br />
银行名称：{{result.bank}}<br />
状态：<span ng-if="result.status==0">待付 </span><span ng-if="result.status==1">已付</span><span ng-if="result.status==2">已撤销</span><br /><span ng-if="result.status==3">阻断交易</span><br />
                        </p>
                  	</div>
                   <div class="form-group">&nbsp;</div>
	            </div> <!-- col-sm-12 col-md-12 end -->
            </div><!-- modal-conteng end -->
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 易宝退款详细 -->
<div class="modal fade" id="queryRefund" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;height:392px; ">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">充值详细</h4>
            </div>
            <div class="modal-body">
            	<div class="col-sm-12 col-md-12">
	                <div class="form-group">&nbsp;</div>
           			<div class="form-group"  style=" height:332px; ">
                        <p class="col-lg-6">
客户退货订单： {{result.orderid}}<br />
易宝退货流水： {{result.yborderid}}<br />
退货金额（分）： {{result.amount}}<br />
退货手续费（分）： {{result.fee}}<br />
下单时间： {{result.ordertime}}<br />
状态：<span ng-if="result.status==4">处理中 </span><span ng-if="result.status==5">退款成功</span><br />
                        </p>
                  	</div>
                   <div class="form-group">&nbsp;</div>
	            </div> <!-- col-sm-12 col-md-12 end -->
            </div><!-- modal-conteng end -->
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 退款对话框 -->
<div class="modal fade" id="refundDialog" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">退款</h4>
            </div>
            <div class="modal-body">
                                                     确认要退款吗？
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" ng-click="comfirmRefund()" data-dismiss="modal">确认退款</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div><!-- /.modal -->

